﻿// <copyright file="IShapeProvider.cs" company="Signal Processing Lab, Wuhan University">
// Copyright (c) 2009-2010 All Right Reserved
// </copyright>
// <author>Xinping Deng</author>
// <email>dentoby@gmail.com</email>
// <date>2010-4</date>
// <summary>This is part of Image.NET project.</summary>

namespace SPLWHU.Core.Vectors
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// The geometry shape provider. Reads and writes the <see cref="Feature"/>s to a file or data set.
    /// </summary>
    public interface IShapeProvider
    {
        /// <summary>
        /// Gets the count of geometries in the collection.
        /// </summary>
        /// <value>The number of geometries.</value>
        int Count { get; }

        /// <summary>
        /// Gets or sets the feature at the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <returns>The geometry at the specified index.</returns>
        Feature this[int index] { get; set; }

        /// <summary>
        /// Adds a new feature to the collection.
        /// </summary>
        /// <param name="feature">The feature added.</param>
        void Add(Feature feature);

        /// <summary>
        /// Adds an array of features to the collection.
        /// </summary>
        /// <param name="features">The features added.</param>
        void Add(Feature[] features);

        /// <summary>
        /// Adds a list of features to the collection.
        /// </summary>
        /// <param name="features">The features added.</param>
        void Add(List<Feature> features);

        /// <summary>
        /// Removes the geometry at the specifed index.
        /// </summary>
        /// <param name="index">The index.</param>
        void RemoveAt(int index);

        /// <summary>
        /// Removes the specified feature.
        /// </summary>
        /// <param name="feature">The feature removed.</param>
        void Remove(Feature feature);

        /// <summary>
        /// Clears all features in this provider.
        /// </summary>
        void Clear();

        /// <summary>
        /// Gets the geometries within the bounding box.
        /// </summary>
        /// <param name="bbox">The bounding box.</param>
        /// <returns>A list of geometries.</returns>
        List<Feature> GetFeatures(BoundingBox bbox);

        /// <summary>
        /// Gets the enumerator of all features.
        /// </summary>
        /// <returns>The enumerator to access the features.</returns>
        IEnumerable<Feature> GetFeatures();
    }
}
